﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.Master" AutoEventWireup="true" CodeBehind="BGM_Strategy_Data_List.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Strategy_Data_List" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<%@ Register src="../Controls/Panel/UserPanel.ascx" tagname="UserPanel" tagprefix="uc3" %>
<%@ Register src="../Controls/Panel/CommandPanel.ascx" tagname="CommandPanel" tagprefix="uc4" %>
<%@ Register src="../Controls/Combo/StrategyTypeCombo.ascx" tagname="StrategyTypeCombo" tagprefix="uc1" %>
<%@ Register src="../Controls/Combo/YearCombo.ascx" tagname="year" tagprefix="uc8" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
<link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css" />
<script src="../../Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None"  > 
</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager runat="server" ID="RadManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
    <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="panelCommand">
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="panelList" LoadingPanelID="RadAjaxLoadingPanel1"/> 
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" LoadingPanelID="RadAjaxLoadingPanel1"/>                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="panelGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="panelList" LoadingPanelID="RadAjaxLoadingPanel1"/>
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" LoadingPanelID="RadAjaxLoadingPanel1"/>                                               
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>



<%-- <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function chkSelect(sender, args) {
            var grid = $find("<%= Grid.ClientID %>");
            var masterTable = grid.get_masterTableView();
            if (masterTable.get_selectedItems().length == 0) {
                alert("Please select the items you want to delete.");
                return true;
            }
            else {
                return !confirm('Delete selected data?'));
            }
        }
    
    </script>
 </telerik:RadCodeBlock>--%>

<div class="defaultFont">
<asp:Label ID="hdSeq" runat="server" ></asp:Label>
<table style="width: 980px; height: 100%;" >
    <tr>
        <td>
        <!-- Command Control -->    
            <asp:Panel ID="panelCommand" runat="server" > 
                <div class="DivInfo" id="blockCommand" runat="server" >
                    <table cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                <asp:LinkButton ID="lbtShowGrid" runat="server" CssClass="ControlLinkButton" 
                                    CommandName="ShowGrid" oncommand="CommandFire" CausesValidation="false">
                                    <img alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;แสดงข้อมูลทั้งหมด
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtAddNew" runat="server" CssClass="ControlLinkButton"
                                    CommandName="AddNew" oncommand="CommandFire" >
                                    <img alt="" src="../Image/Grid/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtEdit" runat="server" CssClass="ControlLinkButton"
                                    CommandName="Edit" oncommand="CommandFire">
                                    <img alt="" src="../Image/Grid/Edit.gif" />&nbsp;&nbsp;แก้ไขข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtDelete" runat="server" CssClass="ControlLinkButton" 
                                    CommandName="Delete" oncommand="CommandFire" >
                                    <img alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtSave" runat="server" CssClass="ControlLinkButton" 
                                    CommandName="Save" oncommand="CommandFire">
                                    <img alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                </asp:LinkButton>
                                <asp:LinkButton ID="lbtCancel" runat="server" CssClass="ControlLinkButton"
                                    CommandName="Cancel" oncommand="CommandFire" CausesValidation="false">
                                    <img alt="" src="../Image/Grid/Cancel.gif" />&nbsp;&nbsp;ยกเลิกทั้งหมด
                                </asp:LinkButton> 
                            </td>
                        </tr>
                    </table> 
                </div>     
            </asp:Panel>
        <!-- End Command Control -->
        </td>
    </tr> 
    <tr>
        <td valign = "top" colspan="2">
             <br />
                <div class="header-grid">
                    <div class="defaultFont">
                        ข้อมูลทะเบียนคุมแผนยุทธศาสตร์ 
                    </div>
                </div>
                <asp:Panel ID="panelList" runat="server" ScrollBars="Auto" Visible="false">
                    <ul id="SourceTypeInfo" class="formList">
                        <li><table><tr><td width="150px">รหัส :</td><td><asp:Label ID="lbCode" runat="server" AssociatedControlID="txtCode"></asp:Label>
                            <asp:TextBox ID="txtCode" runat="server" Visible="True" Width="150px" 
                                ValidationGroup="1" ></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="txtCode" ErrorMessage="*" SetFocusOnError="True" 
                                ValidationGroup="1"></asp:RequiredFieldValidator>
                            </td></tr></table>
                        </li>
                        <li>
                            <table>
                                <tr>
                                    <td width = "150px">
                                        รหัสในระบบ GFMIS :
                                    </td>
                                    <td>
                                        <asp:Label runat="server" ID="lbGFMISCode" AssociatedControlID="txtGFMISCode"></asp:Label>
                                        <asp:TextBox ID="txtGFMISCode" runat="server" Visible="True" Width="150px" ValidationGroup="1"></asp:TextBox>
                                         <input id="hGFMISCode" runat="server" type="hidden" />
                                        
                                    </td>
                                </tr>
                            </table>
                        </li>
                        <li><table><tr><td valign="top" width="150px">ประเภทยุทธศาสตร์ :</td><td><asp:Label ID="lbType" runat="server" AssociatedControlID="cbType"></asp:Label>
                            <uc1:StrategyTypeCombo ID="cbType" runat="server" />
                            </td></tr></table>
                        </li>
                        <li><table><tr><td width="150px">ชื่อยุทธศาสตร์ :</td><td><asp:Label ID="lbName" runat="server" AssociatedControlID="txtName"></asp:Label>
                            <asp:TextBox ID="txtName" runat="server" Text="" Visible="True" Width="300px" 
                                ValidationGroup="1"></asp:TextBox>
                            <asp:RequiredFieldValidator
                                    ID="TextBoxRequiredFieldValidator"
                                    Runat="server"
                                    Display="Dynamic"
                                    ControlToValidate="txtName"
                                    ErrorMessage="กรุณากรอกชื่อยุทธศาสตร์" >
                                </asp:RequiredFieldValidator>
                            </td></tr></table>
                        </li>
                        <li><table><tr><td valign="top" width="150px">คำอธิบาย :</td><td><asp:Label ID="lbDescr" runat="server" AssociatedControlID="txtDescr"></asp:Label>
                            <asp:TextBox ID="txtDescr" runat="server" loginUser="100"  Text="" TextMode="MultiLine" Visible="True" Width="300px"></asp:TextBox></td></tr></table>
                        </li>
                        
                        <li><table><tr><td valign="top" width="150px">ปีเริ่มต้น :</td><td><asp:Label ID="Label1" runat="server" AssociatedControlID="ysCombo"></asp:Label>
                                <telerik:RadComboBox ID="ysCombo" runat="server" CssClass="textbox-string" 
                                Width="150px">
                                    <Items>
                                    </Items>
                                </telerik:RadComboBox>
                            </td></tr></table>
                        </li>
                        <li><table><tr><td valign="top" width="150px">ปีสิ้นสุด :</td><td><asp:Label ID="Label2" runat="server" AssociatedControlID="yeCombo"></asp:Label>
                                <telerik:RadComboBox ID="yeCombo" runat="server" Width="150px" 
                                    CssClass="textbox-string" >
                                <Items>
                                </Items>
                                </telerik:RadComboBox>                           
                            </td></tr></table>
                        </li>
                        <li class="lastListItem">
                        </li>
                    </ul>
                </asp:Panel>
                <asp:Panel ID="panelGrid" runat="server" Visible="true">
                    <br />
                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="Grid" 
                        runat="server" AllowFilteringByColumn="True"
                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                        AutoGenerateColumns="False" OnItemCommand="Grid_ItemCommand"
                        GridLines="None" CellSpacing="0">
                        <MasterTableView AllowMultiColumnSorting="true" DataKeyNames="Sequence" ClientDataKeyNames="Sequence"
                            Width="100%" NoMasterRecordsText="No records to display. ">
                            <%--<EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>--%>
                            <PagerStyle Mode="NextPrevAndNumeric" />
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                                Visible="True">
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                                Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="StrategyType.Name" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderStyle-Width="150px" HeaderText="ประเภทยุทธศาสตร์" ShowFilterIcon="false" 
                                    UniqueName="StrategyType.Name">
                                    <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Code" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" HeaderText="รหัส" 
                                    ItemStyle-HorizontalAlign="Center" ItemStyle-Width="70px" 
                                    ShowFilterIcon="false" UniqueName="Code">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" Width="70px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="gfmis_code" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderStyle-Width="80px" HeaderText="รหัส GFMIS" 
                                    ItemStyle-HorizontalAlign="Left" ShowFilterIcon="false" UniqueName="gfmis_code">
                                    <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Name" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" ShowFilterIcon="false" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label ID="targetSequence" runat="server" Text='<%# Eval("Sequence") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Name" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" HeaderText="ชื่อยุทธศาสตร์" 
                                    ShowFilterIcon="false" UniqueName="Name">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="targetControl" runat="server" CommandName="TargetClick" 
                                            Text='<%# Eval("Name") %>'></asp:LinkButton>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                <%--                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="Description" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderText="คำอธิบาย" ShowFilterIcon="false" UniqueName="Description">
                                </telerik:GridBoundColumn>--%>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="YearStart" 
                                    FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                    HeaderStyle-Width="100px" HeaderText="ปีที่เริ่มต้น" ShowFilterIcon="false" 
                                    UniqueName="YearStart">
                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                    CurrentFilterFunction="Contains" DataField="YearEnd" FilterControlWidth="100%" 
                                    HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="100px" 
                                    HeaderText="ปีที่สิ้นสุด" ShowFilterIcon="false" UniqueName="YearEnd">
                                    <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                        <GroupingSettings CaseSensitive="False" />
                        <ClientSettings EnableRowHoverStyle="true" >
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents  />
                        </ClientSettings>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </asp:Panel>
    </td>
    </tr>
    </table>    
</div>
</asp:Content>
